﻿

if not Exists(select * from sysobjects where name = 'NewsLetterUnsubscription' and Xtype = 'U') 
Begin

	Create table dbo.NewsLetterUnsubscription (
		Id int identity(1,1) not null,
		CreationDate datetime not null,
		Email varchar(512) not null,
		NewsLetterId int null
	)

	alter table dbo.NewsLetterUnsubscription add constraint PK_NewsLetterUnsubscription_Id primary key nonclustered (Id)

	create unique clustered index IX_NewsLetterUnsubscription_Email on NewsLetterUnsubscription(Email)

End